package MapBase.logic.control.MapBaseControl.Mouse
{
	/**
	 *拖动实体 
	 */	
	import MapBase.logic.MapBase;
	
	import com.friendsofed.isometric.IsoObject;

	public class MapBaseDragEntity
	{
		public function MapBaseDragEntity()
		{	
		}
		
		static public  function MDownCMD(mapBase:MapBase,selectEntityLayer:Boolean,dragEntity:Boolean,delEntity:Boolean,showEntityFloor:Boolean):void
		{
			if(!selectEntityLayer) return;
			
			if(!dragEntity) return;
			
			if(delEntity) return;
			
			var isoObj : IsoObject = mapBase.getMouseClickObj();
			
			if(showEntityFloor)
			{
				mapBase.showEntityFloor();
			}
			
			if(isoObj && !delEntity)
			{
				isoObj.startDrag();
			}
		}
		
		static public  function MUpCMD(mapBase:MapBase,dragEntity:Boolean):void
		{
			if(dragEntity)
			{
				if(mapBase.curMouseObj)
				{
					mapBase.curMouseObj.stopDrag();
					mapBase.updateCurMouseObj();
					mapBase.world.sort();
				}
			}
		}
	}
}